import request from '@/utils/request'

const api_name = '/oa/oaProcess'

export default {
  /**
   * 查询待处理的任务
   */
  findPending(pageNo,pageSize){
    return request({
      url: `${api_name}/findPending/${pageNo}/${pageSize}`,
      method: 'get'
    })
  },
  /**
   * 发起流程
   * @param processFormVo
   * @returns {*}
   */
  startUp(processFormVo){
    return request({
      url: `${api_name}/startUp`,
      method: 'post',
      data: processFormVo
    })
  },
  /**
   *  获取全部审批分类及模板
   */
  findProcessType(){
    return request({
      url: `${api_name}/findProcessType`,
      method: 'get'
    })
  },
  /**
   * 分页查询
   */
  getPageList(pageNo,pageSize,searchObj){
    return request({
      url: `${api_name}/getPageList/${pageNo}/${pageSize}`,
      method: 'get',
      params: searchObj
    })
  },
  save(data){
    return request({
      url: `${api_name}/save`,
      method: 'post',
      data: data
    })
  },
  update(data){
    return request({
      url: `${api_name}/update`,
      method: 'put',
      data: data
    })
  },
  delete(id){
    return request({
      url: `${api_name}/delete/id`,
      method:"delete",
    })
  }
}
